﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace INSTA.MusiqueStore.DAL
{
    public    class AddCustomer
    {
        public static   Client     _client;
        public  static void addCustomer(string nom, string prenom, string email,string passwd, bool estadmin )
        {
            using (MusiqueStoreEntities context=new MusiqueStoreEntities() )
            {
                try
                {
                    _client = new Client();
                    _client.Nom = nom;
                    _client.Prénom = prenom;
                    _client.Email = email;
                    _client.Password = passwd;
                    _client.EstAdmin = estadmin;
                    context.Clients.Add(_client);
                    context.SaveChanges();

                }
                catch (Exception)
                {
                   // UnknownCustomerException exception=new UnknownCustomerException();
                    
                    throw;
                }
            }
            
        }
    }
}
